<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <meta charset="utf-8">
    <title>系统设置</title>
    <link rel="stylesheet" href="${contextPath}/css/ElementCss/theme/index.css">
    <link rel="stylesheet" href="${contextPath}/css/home.css"/>
</head>
<style>
    /*额外增加的修改样式*/
    /*.el-form-item {*/
    /*margin-bottom: 0px !important;*/
    /*}*/

    .el-radio-group {
        margin-top: 7px;
    }

    .el-table .cell {
        white-space: pre-line;
    }

    .el-table__empty-block {
        height: 80% !important;
    }

    .lonlatDiv {
        width: 100%;
    }

    .lonlatDivTip {
        width: 40%;
        float: left;
    }

    .offOnline {
        position: fixed;
        bottom: 14px;
        left: 12px;
        cursor: pointer;
    }

    .addIcon {
        float: right;
    }
    [v-cloak] {
        display: none;
    }
</style>
<body>

<div id="main" class="all" v-cloak>
    <div class="allLeft">
        <!-- 左侧菜单栏 -->
        <div class="menuLeft" v-for="(menu,index) in menuLefts" @click="leftSwitch(index)"
             v-bind:class="{menuLeftS: leftNum== index}">
            <img v-bind:src="menu.url"/><br/>{{$t(menu.title)}} <br/>
            <hr/>
        </div>

        <div class="offOnline">
            <img v-bind:src="circleUrl" @click="offOnline()"> </img>
            <%--<el-avatar shape="square" :size="100" :fit="fit" :src="circleUrl"></el-avatar>--%>
            <%--<el-avatar :src="circleUrl"></el-avatar>--%>
            <%--<el-avatar :size="size" :src="circleUrl"></el-avatar> --%>
        </div>
    </div>
    <div class='allRight rightBaseDiv'>
        <%--用户管理的按钮--%>
        <div class="rightTopDiv" v-show="userTableShow">
            <div class="TopDivLeftDiv">
                <el-input v-model="queryText" :placeholder="$t('homeSystem.Please_enter_the_searched_account')"
                          class="TopDivLeftInput"></el-input>
                <el-button type="primary" class="TopDivLeftBut" @click="queryName">{{$t('homeSystem.search_for')}}
                </el-button>
            </div>
            <div class="TopDivRight">
                <div class="selectSpan">
                    <el-button type="primary" @click="addUser()">{{$t('homeSystem.Add_to')}}</el-button>
                </div>
            </div>

        </div>
        <%--爬虫管理的button--%>
        <div class="rightTopDiv" v-show="crawlerTableShow">
            <div class="TopDivRight">
                <div class="selectSpan">
                    <el-button type="primary" :disabled="activeCrlawerFlose" @click="openCrawler()">{{crawlerButText}}
                    </el-button>
                </div>
            </div>
        </div>
        <%--影像下载的按钮--%>
        <div class="rightTopDiv" v-show="imageTableShow">
            <div class="TopDivRight">
                <div class="selectSpan">
                    <el-button type="primary" :disabled="activeImageFlose" @click="openImage()">{{imageButText}}
                    </el-button>
                </div>
            </div>
        </div>
        <%--硬件接入--%>
        <div class="rightTopDiv" v-show="hardwareTableShow">
            <div class="TopDivRight">
                <div class="selectSpan">
                    <el-button type="primary" :disabled="activeHardwareFlose" @click="openHardware()">
                        {{hardwareButText}}
                    </el-button>
                </div>
            </div>
        </div>

        <div class="rightBottemDiv">
            <div class="rightTable" style="overflow-y: auto;">
                <%--用户表格--%>
                <el-table :data="usertableData" stripe style="width: 100%" v-show="userTableShow">
                    <el-table-column type="index" :label="$t('homeResultData.number')" width="100">
                    </el-table-column>
                    <el-table-column prop="nickName" :label="$t('homeSystem.username')" width="120">
                    </el-table-column>
                    <el-table-column prop="userName" :label="$t('homeSystem.user_password')" width="150">
                    </el-table-column>
                    <el-table-column prop="passWord" :label="$t('homeSystem.user_account')" width="160">
                    </el-table-column>
                    <el-table-column :formatter="crawlerState" prop="sex" :label="$t('homeSystem.gender')" width="80">
                    </el-table-column>
                    <el-table-column prop="phone" :label="$t('homeSystem.phone')" width="150">
                    </el-table-column>
                    <el-table-column prop="email" :label="$t('homeSystem.mailbox')">
                    </el-table-column>
                    <el-table-column prop="usertype" :label="$t('homeSystem.userType')">
                    </el-table-column>
                    <el-table-column prop="operation" :label="$t('homeSystem.operating')" width="200">
                        <template slot-scope="scope">
                            <el-button
                                    size="mini"
                                    @click="updataUser(scope.row)">{{$t('homeSystem.edit')}}
                            </el-button>
                            <el-button v-if="scope.row.deleteFlag==1"
                                       size="mini" type="danger"
                                       @click="deleteUser(0,scope.row)">{{$t('homeSystem.Resign')}}
                            </el-button>
                            <el-button v-if="scope.row.deleteFlag==0"
                                       size="mini" type="primary"
                                       @click="deleteUser(1,scope.row)">{{$t('homeSystem.reinstatement')}}
                            </el-button>
                        </template>
                    </el-table-column>
                </el-table>
                
                
                <%--属性表--%>
                <el-table :data="usertableData" stripe style="width: 100%;text-align: center"
                          v-show="proTableShow">
                    <el-table-column type="index" :label="$t('homeResultData.number')" width="100">
                    </el-table-column>
                    <el-table-column prop="proNamech" :label="$t('homeSystem.Property_name')">
                    </el-table-column>
                    <el-table-column prop="proRed" :label="$t('homeSystem.red_range')">
                        <template slot-scope="scope">
                            <div v-html="scope.row.proRed"></div>
                        </template>
                    </el-table-column>
                    <el-table-column prop="proYellow" :label="$t('homeSystem.yellow_range')">
                    </el-table-column>
                    <el-table-column prop="proGreen" :label="$t('homeSystem.green_range')">
                    </el-table-column>
                    <el-table-column prop="proUnit" :label="$t('homeSystem.unit')">
                    </el-table-column>
                    <%--<el-table-column prop="proType" :label="$t('homeSystem.category')">--%>
                    <%--</el-table-column>--%>
                    <%--<el-table-column :formatter="crawlerState" prop="proFiletype" :label="$t('homeSystem.Owning_file')">--%>
                    <%--</el-table-column>--%>

                    <%--<el-table-column prop="wareType" :label="$t('homeSystem.category')"  >--%>
                    <%--</el-table-column>--%>
                    <el-table-column prop="operation" :label="$t('homeSystem.operating')" width="150">
                        <template slot-scope="scope">
                            <el-button size="mini" type="primary"
                                       @click="proSweet(0,scope.row)">{{$t('homeResultData.Fix')}}
                            </el-button>
                        </template>
                    </el-table-column>

                </el-table>
	
	 <%--读取设置--%>
                <el-table :data="readSetData" stripe style="width: 100%" v-show="proSetTableShow">
                    <el-table-column type="index" :label="$t('homeResultData.number')" width="100">
                    </el-table-column>
                    <el-table-column prop="modelName" :label="$t('readSet.modelName')"  width="200px">
                    </el-table-column>
                    <el-table-column prop="fileName" :label="$t('readSet.fileName')" width="200px">
                    </el-table-column>
                   <el-table-column prop="updateUser" :label="$t('readSet.updateUser')" width="200px">
                    </el-table-column>
                  <el-table-column prop="explains" :label="$t('readSet.explains')" width="500px">
                    </el-table-column>

                    <el-table-column prop="state" :label="$t('homeSystem.operating')" width="150">
                        <template slot-scope="scope">
                            <el-button v-if="scope.row.state==1"
                                       size="mini" type="danger"
                                       @click="updateState(0,scope.row.id)">{{$t('readSet.stateB')}}
                            </el-button>
                            <el-button v-if="scope.row.state==0"
                                       size="mini" type="primary"
                                       @click="updateState(1,scope.row.id)">{{$t('readSet.stateA')}}
                            </el-button>

                        </template>
                    </el-table-column>
                </el-table>
                
                <div class="rightTableFoot" v-show="footShow">
                    <el-pagination
                            @current-change="handleCurrentChange"
                            background
                            layout="prev, pager, next" :total=totalCont>
                    </el-pagination>
                </div>


                <%--爬虫表格--%>
                <el-table :data="crawlerTableData" stripe style="width: 100%;text-align: center"
                          v-show="crawlerTableShow">
                    <el-table-column type="index" :label="$t('homeResultData.number')" width="100">
                    </el-table-column>
                    <el-table-column :formatter="crawlerState" prop="crawlerTitle" :label="$t('homeSystem.title')"
                                     width="180">
                    </el-table-column>
                    <%--<el-table-column  prop="carwlerType" :label="$t('homeSystem.frequency')">--%>
                    <%--</el-table-column>--%>
                    <el-table-column :formatter="common.dateFormatTime" prop="crawlerTime"
                                     :label="$t('homeSystem.Last_execution_time')" min-width="160px">
                    </el-table-column>
                    <el-table-column :formatter="crawlerState" prop="crawlerState"
                                     :label="$t('homeSystem.Current_state')">
                    </el-table-column>
                    <el-table-column prop="todayNumber" :label="$t('homeSystem.Crawls_today')">
                    </el-table-column>
                    <el-table-column prop="carwlerCount" :label="$t('homeSystem.Number_of_crawls_today')">
                    </el-table-column>
                    <el-table-column prop="operation" :label="$t('homeSystem.operating')" width="200">
                        <template slot-scope="scope">
                            <%--<el-button--%>
                            <%--size="mini"--%>
                            <%--@click="updataCralwer(scope.row)">{{$t('homeSystem.edit')}}--%>
                            <%--</el-button>--%>
                            <el-button v-if="scope.row.crawlerState==1"
                                       size="mini" type="danger"
                                       @click="activateTask(0,scope.row)">{{$t('homeSystem.stop')}}
                            </el-button>
                            <el-button v-if="scope.row.crawlerState==0"
                                       size="mini" type="primary"
                                       @click="activateTask(1,scope.row)">{{$t('homeSystem.start_up')}}
                            </el-button>
                        </template>
                    </el-table-column>
                </el-table>
                <%--影像表格--%>
                <el-table :data="imageTableData" stripe style="width: 100%" v-show="imageTableShow">
                    <el-table-column type="index" :label="$t('homeResultData.number')" width="100">
                    </el-table-column>
                    <el-table-column prop="crawlerRemarks" :label="$t('homeSystem.satellite')">
                    </el-table-column>
                    <el-table-column prop="ftpRemark" :label="$t('homeSystem.sensor')" min-width="80px">
                    </el-table-column>
                    <el-table-column :formatter="LongLat" prop="ftpRemark"
                                     :label="$t('homeSystem.Latitude_and_longitude')" min-width="140px">
                    </el-table-column>
                    <%--<el-table-column prop="downloadState" :label="当前状态" min-width="80px">--%>
                    <%--<template scope="scope">--%>
                    <%--<el-switch--%>
                    <%--v-model="scope.row.downloadState"--%>
                    <%--:active-value="1"--%>
                    <%--:inactive-value="0"--%>
                    <%--active-color="#13ce66"--%>
                    <%--inactive-color="#ff4949" @change="imageSweet(scope.row)">--%>
                    <%--</el-switch>--%>
                    <%--</template>--%>
                    <%--</el-table-column>--%>
                    <el-table-column prop="savePath" :label="$t('homeSystem.Storage_path')" min-width="160px">
                    </el-table-column>
                    <el-table-column prop="operation" :label="$t('homeSystem.operating')" width="150">
                        <template slot-scope="scope">
                            <%--<el-button :disabled="(scope.row.crawlerRemarks!='MODIS')"--%>
                            <%--size="mini"--%>
                            <%--@click="updataImage(scope.row)">{{$t('homeSystem.edit')}}--%>
                            <%--</el-button>--%>
                            <el-button v-if="scope.row.downloadState==1"
                                       size="mini" type="danger"
                                       @click="imageSweet(0,scope.row)">{{$t('homeSystem.stop')}}
                            </el-button>
                            <el-button v-if="scope.row.downloadState==0"
                                       size="mini" type="primary"
                                       @click="imageSweet(1,scope.row)">{{$t('homeSystem.start_up')}}
                            </el-button>

                        </template>
                    </el-table-column>
                </el-table>

                <el-table :data="hardwareTableData" stripe style="width: 100%;text-align: center"
                          v-show="hardwareTableShow">
                    <el-table-column type="index" :label="$t('homeResultData.number')" width="100">
                    </el-table-column>
                    <%--<el-table-column prop="wareName" :label="$t('homeSystem.title')" >--%>
                    <%--</el-table-column>--%>
                    <el-table-column prop="wareUrl" :label="$t('homeSystem.download_link')">
                    </el-table-column>
                    <el-table-column prop="wareData" :label="$t('homeSystem.Parsed_file_name')">
                    </el-table-column>
                    <el-table-column prop="wareUsername" :label="$t('homeSystem.account_number')">
                    </el-table-column>
                    <%--<el-table-column prop="wareType" :label="$t('homeSystem.category')"  >--%>
                    <%--</el-table-column>--%>
                </el-table>
            </div>
        </div>

    </div>
    <%--修改属性--%>
    <el-dialog :title="$t('homeSystem.Modify_properties')" :visible.sync="proLayer" width="50%">
        <el-form :model="proFromUpdata" label-width="115px">
            <el-form-item :label="$t('homeSystem.Property_name')">
                <el-input :disabled="true" v-model="proFromUpdata.proNamech"></el-input>
            </el-form-item>
            <el-form-item :label="$t('homeSystem.red_range')">
                <div class="lonlatDiv" v-for="(menu,index) in redRange"   >
                    <div class="lonlatDivTip">
                        <el-input v-model="menu.max">
                            <template slot="prepend">{{$t('homeResultDataJsp.max')}}</template>
                        </el-input>
                    </div>
                    <div class="lonlatDivTip">
                        <el-input v-model="menu.min">
                            <template slot="append">{{$t('homeResultDataJsp.min')}}</template>
                        </el-input>
                    </div>
                </div>
                <div class="addIcon">
                    <el-button type="primary" icon="el-icon-circle-plus-outline" @click="adddProRange(0)"></el-button>
                </div>
            </el-form-item>

            <el-form-item :label="$t('homeSystem.yellow_range')">
                <div class="lonlatDiv" v-for="(menu,index) in yellowRange"   >
                    <div class="lonlatDivTip">
                        <el-input v-model="menu.max">
                            <template slot="prepend">{{$t('homeResultDataJsp.max')}}</template>
                        </el-input>
                    </div>
                    <div class="lonlatDivTip">
                        <el-input v-model="menu.min">
                            <template slot="append">{{$t('homeResultDataJsp.min')}}</template>
                        </el-input>
                    </div>
                </div>
                <div class="addIcon">
                    <el-button type="primary" icon="el-icon-circle-plus-outline" @click="adddProRange(1)"></el-button>
                </div>
            </el-form-item>
            <el-form-item :label="$t('homeSystem.green_range')">
                <div class="lonlatDiv" v-for="(menu,index) in greenRange"   >
                    <div class="lonlatDivTip">
                        <el-input v-model="menu.max">
                            <template slot="prepend">{{$t('homeResultDataJsp.max')}}</template>
                        </el-input>
                    </div>
                    <div class="lonlatDivTip">
                        <el-input v-model="menu.min">
                            <template slot="append">{{$t('homeResultDataJsp.min')}}</template>
                        </el-input>
                    </div>
                </div>
                <div class="addIcon">
                    <el-button type="primary" icon="el-icon-circle-plus-outline" @click="adddProRange(2)"></el-button>
                </div>
            </el-form-item>

            <el-form-item :label="$t('homeSystem.unit')">
                <el-input v-model="proFromUpdata.proUnit"></el-input>
            </el-form-item>
        </el-form>
        <div slot="footer" class="dialog-footer">
            <el-button @click="proLayer = false">{{$t('homeResultData.cancel')}}</el-button>
            <el-button type="primary" @click="subPro()"> {{$t('homeResultData.sure')}}</el-button>
        </div>
    </el-dialog>
    <%--修改的弹窗--%>
    <el-dialog :visible.sync="dialogFormVisible" width="30%">
        <el-form :model="UserFormUpdata" size="mini">
            <el-form-item :label="$t('homeSystem.username')">
                <el-input v-model="UserFormUpdata.nickName"></el-input>
            </el-form-item>
            <el-form-item :label="$t('homeSystem.account_number')">
                <el-input v-model="UserFormUpdata.userName"></el-input>
            </el-form-item>
            <el-form-item :label="$t('homeSystem.user_password')">
                <el-input v-model="UserFormUpdata.passWord"></el-input>
            </el-form-item>
            <el-form-item :label="$t('homeSystem.gender')" class="reidoClass">
                <el-radio-group v-model="UserFormUpdata.sex">
                    <el-radio :label="$t('homeSystem.male')"></el-radio>
                    <el-radio :label="$t('homeSystem.Female')"></el-radio>
                </el-radio-group>
            </el-form-item>
            <el-form-item :label="$t('homeSystem.usertype')" class="reidoClass">
                <el-radio-group v-model="UserFormUpdata.usertype">
                    <el-radio :label="$t('homeSystem.userType1')"></el-radio>
                    <el-radio :label="$t('homeSystem.userType2')"></el-radio>
                </el-radio-group>
            </el-form-item>
            <el-form-item :label="$t('homeSystem.phone')">
                <el-input v-model="UserFormUpdata.phone"></el-input>
            </el-form-item>
            <el-form-item :label="$t('homeSystem.mailbox')">
                <el-input v-model="UserFormUpdata.email"></el-input>
            </el-form-item>
        </el-form>
        <div slot="footer" class="dialog-footer">
            <el-button @click="dialogFormVisible = false"> {{$t('homeResultData.cancel')}}</el-button>
            <el-button type="primary" @click="subUser()"> {{$t('homeResultData.sure')}}</el-button>
        </div>
    </el-dialog>

    <%--爬虫信息--%>
    <el-dialog :title="$t('homeSystem.Crawler_title')" :visible.sync="crawlerDialogFormVisible" width="30%">
        <el-form :model="formCrawlerUpdate" label-width="80px">
            <el-form-item :label="$t('homeSystem.Crawler_information')">
                <el-input :disabled="true" v-model="formCrawlerUpdate.crawlerTitle"></el-input>
            </el-form-item>
            <br/><br/>
            <el-form-item :label="$t('homeSystem.Crawler_frequency')">
                <el-select v-model="formCrawlerUpdate.carwlerType" placeholder="请选择">
                    <el-option
                            v-for="item in crawlerOptions"
                            :key="item.value"
                            :label="item.value"
                            :value="item.value">
                    </el-option>
                </el-select>
            </el-form-item>
        </el-form>
        <div slot="footer" class="dialog-footer">
            <el-button @click="crawlerDialogFormVisible = false"> {{$t('homeResultData.cancel')}}</el-button>
            <el-button type="primary" @click="subCrawler()"> {{$t('homeResultData.sure')}}</el-button>
        </div>
    </el-dialog>

    <%--影像信息--%>
    <el-dialog :title="$t('homeSystem.Crawler_information')" :visible.sync="imageDialogFormVisible" width="60%">
        <el-form :model="formImageUpdate" label-width="80px">
            <el-form-item :label="$t('homeSystem.sensor')">
                <el-input :disabled="true" v-model="formImageUpdate.crawlerRemarks"></el-input>
            </el-form-item>
            <el-form-item :label="$t('homeSystem.Latitude_and_longitude')">
                <el-input :disabled="true" v-model="formImageUpdate.ftpRemark"></el-input>
            </el-form-item>
            <el-form-item :label="$t('homeSystem.sensor')">
                <div class="lonlatDiv">
                    <div class="lonlatDivTip">
                        <el-input v-model="formImageUpdate.latLeft">
                            <template slot="append">°E</template>
                        </el-input>
                    </div>
                    <div class="lonlatDivTip">
                        <el-input v-model="formImageUpdate.lonDown">
                            <template slot="append">°N</template>
                        </el-input>
                    </div>
                    <div class="lonlatDivTip">
                        <el-input v-model="formImageUpdate.latRight">
                            <template slot="append">°E</template>
                        </el-input>
                    </div>
                    <div class="lonlatDivTip">
                        <el-input v-model="formImageUpdate.lonUp">
                            <template slot="append">°N</template>
                        </el-input>
                    </div>
                </div>
            </el-form-item>
        </el-form>
        <div slot="footer" class="dialog-footer">
            <el-button @click="imageDialogFormVisible = false">{{$t('homeResultData.cancel')}}</el-button>
            <el-button type="primary" @click="subImage()"> {{$t('homeResultData.sure')}}</el-button>
        </div>
    </el-dialog>

</div>


</body>
<script src="${contextPath}/js/vue.js" type="text/javascript" charset="utf-8"></script>
<script src="${contextPath}/js/elementIndex.js"></script>
<script src="${contextPath}/js/vueApp.js" type="text/javascript" charset="utf-8"></script>
<script src="${contextPath}/js/vue-resource.js"></script>

<script src="${contextPath}/js/language/languages.js" type="text/javascript" charset="utf-8"></script>

<%--公共方法--%>
<script src="${contextPath}/js/homeJS/publicTool.js"></script>
<%--组件 得在实例化前面--%>
<script src="${contextPath}/js/homeJS/component.js"></script>
<%--语言js--%>
<script src="${contextPath}/js/language/vue-i18n.js"></script>

<script src="${contextPath}/js/homeJS/homeSystem.js"></script>

</html>
